package model

import (
	"gorm.io/gorm"
	"time"
)

type Order struct {
	Id          uint           `gorm:"column:id;type:bigint UNSIGNED;primaryKey;not null;" json:"id"`
	OrderSn     string         `gorm:"column:order_sn;type:varchar(100);not null;" json:"order_sn"`
	OrderStatus uint           `gorm:"column:order_status;type:int;comment:1.已支付 2.未支付;not null;" json:"order_status"` // 1.已支付 2.未支付
	CreatedAt   time.Time      `gorm:"column:created_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"created_at"`
	UpdatedAt   time.Time      `gorm:"column:updated_at;type:datetime(3);not null;default:CURRENT_TIMESTAMP(3);" json:"updated_at"`
	DeletedAt   gorm.DeletedAt `gorm:"column:deleted_at;type:datetime(3);default:NULL;" json:"deleted_at"`
}

func (o *Order) TableName() string {
	return "order"
}
